home *** CD-ROM | disk | FTP | other *** search
- on keytest
- repeat with i = 1 to 50
- put the lastKey
- updateStage()
- end repeat
- end
-
- on enterOffice
- global oStoryteller
- newGame(oStoryteller)
- end
-
- on keyDown
- global oStoryteller
- put "keydown " & random(23)
- if the number of menus > 0 then
- put "menu count > 0"
- pass()
- exit
- end if
- set foo to the key
- put foo
- if "01234567" contains foo then
- do("set the soundLevel to " & foo)
- end if
- if "XxQq" contains the key then
- set the trace to 1
- quitGame(oStoryteller)
- end if
- dontPassEvent()
- end
-
- on fadeOutTransit
- if the frameTransition = 0 then
- repeat with fadeFactor = 30.0 down to 0.0
- repeat with i = 1 to 4
- set the volume of sound i to float(the volume of sound i) * (fadeFactor / 30.0)
- end repeat
- wait(5)
- updateStage()
- end repeat
- else
- repeat with i = 1 to 4
- set the volume of sound i to 0
- end repeat
- updateStage()
- end if
- end
-
- on grabberInit
- global oGrabber, gRippleSize, gCPU, gHorsepower
- set totalRAM to the memorysize / 1024
- if (totalRAM >= 8000) and (gHorsepower <> #low) then
- preLoadCast(2428, 2451)
- set gRippleSize to #large
- else
- if totalRAM >= 6000 then
- preLoadCast(2453, 2472)
- set gRippleSize to #small
- else
- return #lowRAM
- exit
- end if
- end if
- return #OK
- end
-
- on ripple
- global oGrabber, gLastRipple, gRippleSize, gOriginPoint
- if the ticks < (gLastRipple + (3 * 60)) then
- exit
- end if
- if voidp(gRippleSize) then
- set rippleStatus to grabberInit()
- if rippleStatus <> #OK then
- exit
- end if
- end if
- set rippleSprite to 37
- puppetSprite(rippleSprite, 1)
- set the ink of sprite rippleSprite to 9
- if gRippleSize = #small then
- set firstCastPos to 2453
- set lastCastPos to 2471
- set grabWidth to 96
- set grabHeight to 96
- set rippleTempo to 2
- else
- set firstCastPos to 2428
- set lastCastPos to 2450
- set grabWidth to 160
- set grabHeight to 170
- set rippleTempo to 1
- end if
- set clipRegion to rect(the stageLeft + 112, the stageTop + 80, the stageLeft + 534, the stageTop + 356)
- set leftOffset to random(the right of clipRegion - the left of clipRegion - (grabWidth + 2))
- set leftEdge to the left of clipRegion + leftOffset
- set topOffset to random(the bottom of clipRegion - the top of clipRegion - (grabWidth - 2))
- set topEdge to the top of clipRegion + topOffset
- set errCode to ScreenToClipboard(leftEdge, topEdge, leftEdge + grabWidth, topEdge + grabHeight)
- if errCode = "OK" then
- alert("errcode = " & errCode)
- exit
- end if
- set leftEdge to leftEdge - the stageLeft
- set topEdge to topEdge - the stageTop
- set the loc of sprite rippleSprite to point(leftEdge + (grabWidth / 2), topEdge + (grabHeight / 2))
- set the loc of sprite rippleSprite to the loc of sprite rippleSprite + point(1, 1)
- pasteClipBoardInto(member firstCastPos)
- set the castNum of sprite rippleSprite to firstCastPos
- set newPos to firstCastPos + 2
- updateStage()
- repeat while (newPos <= lastCastPos) and not (the commandDown)
- wait(rippleTempo)
- move(cast (newPos - 2), newPos)
- set the castNum of sprite rippleSprite to newPos
- set newPos to newPos + 2
- updateStage()
- end repeat
- move(cast lastCastPos, firstCastPos)
- set the loc of sprite rippleSprite to point(-1000, -1000) + gOriginPoint
- set gLastRipple to the ticks
- end
-
- on rippleWord maskSeries
- global oGrabber, gRippleSize, gOriginPoint, gLastRipple
- if the ticks < (gLastRipple + 60) then
- exit
- end if
- if voidp(gRippleSize) then
- set rippleStatus to grabberInit()
- put "rippleStatus = " & rippleStatus
- if rippleStatus <> #OK then
- exit
- end if
- end if
- set rippleSprite to 37
- puppetSprite(rippleSprite, 1)
- set the ink of sprite rippleSprite to 9
- if maskSeries = #notTheEnd then
- set firstCastPos to 200
- set lastCastPos to 214
- set leftEdge to 124
- set topEdge to 160
- set grabWidth to 392
- set grabHeight to 164
- set rippleTempo to 2
- end if
- updateStage()
- set errCode to ScreenToClipboard(leftEdge, topEdge, leftEdge + grabWidth, topEdge + grabHeight)
- if errCode = "OK" then
- alert("errcode = " & errCode)
- exit
- end if
- set leftEdge to leftEdge - the stageLeft
- set topEdge to topEdge - the stageTop
- set the loc of sprite rippleSprite to point(leftEdge + (grabWidth / 2), topEdge + (grabHeight / 2))
- set the loc of sprite rippleSprite to the loc of sprite rippleSprite + point(1, 1)
- pasteClipBoardInto(member firstCastPos)
- set the castNum of sprite rippleSprite to firstCastPos
- set newPos to firstCastPos + 2
- updateStage()
- repeat while (newPos <= lastCastPos) and not (the commandDown)
- wait(rippleTempo)
- move(cast (newPos - 2), newPos)
- set the castNum of sprite rippleSprite to newPos
- set newPos to newPos + 2
- updateStage()
- end repeat
- move(cast lastCastPos, firstCastPos)
- set the loc of sprite rippleSprite to point(-1000, -1000) + gOriginPoint
- end
-